
<template>
	<el-dialog title="作业详情" visible :show-close="false" :modal-append-to-body="false" class="wrap" size="tiny">
		<i class="el-icon-close close" @click="cancel"></i>
		<el-form label-width="100px" class="form">
			<el-form-item label="班级名称">
				  <el-input v-model="form.bjmc" icon="info" class="select-block"></el-input>
			</el-form-item> 
			<el-form-item label="学生名称">
				  <el-input v-model="form.xsmc"  icon="info" class="select-block"></el-input>
			</el-form-item> 
			<el-form-item label="总星数">
				  <el-input v-model="form.zxs"  icon="info" class="select-block"></el-input>
			</el-form-item> 
			<el-form-item label="跟读">
				  <el-input v-model="form.gd"  icon="info" class="select-block"></el-input>
			</el-form-item> 
			<el-form-item label="朗读">
				  <el-input v-model="form.ld"  icon="info" class="select-block"></el-input>
			</el-form-item> 
			<el-form-item label="背诵">
				  <el-input v-model="form.bs"  icon="info" class="select-block"></el-input>
			</el-form-item> 
			<el-form-item label="总题数">
				  <el-input v-model="form.zts" icon="info" class="select-block"></el-input>
			</el-form-item> 
		</el-form>
		<el-button type="info" class="submit" @click="cancel">确定</el-button>
	</el-dialog>
</template>

<script type="text/javascript">
	import qs from 'qs'
	export default {
		props: ['params'],
		data() {
			return {
				form: {
					bjmc :'',
					xsmc :'',
					zxs :'',
					gd :'',
					ld :'',
					bs :'',
					zts :'',
					id: ''  
				},
			}
		},
		created() {
           this.form.id=this.params.row.id;
			this.loadinfo();
		},
		methods: {
			loadinfo(){
				var logininfo = JSON.parse(localStorage.logininfo);
              this.searchLoading = true;
             var params2 = qs.stringify({
                      xxid:logininfo.xxid,
							 yhid:logininfo.id,
							 id:this.form.id
               })
             //执行
                 this.axios.post(this.$store.state.api + 'tszyjc/info',  params2 )
                 .then(res => {
                  this.form=res.data.data
                 }).catch(res => {
					 this.$message.warning("服务器异常");
			 				this.$emit('close', { type: 'info', cancel: true });
				})
				
				
				
//				 var logininfo = JSON.parse(localStorage.logininfo) ;
//				 this.axios.get(this.$store.state.api+'tszyjc/info',{
//						 params:{
//							 xxid:logininfo.xxid,
//							 yhid:logininfo.id,
//							 id:this.form.id
//						 }
//					}).then( res =>  {
//							this.form=res.data.data
//					 }).catch(res => {
//						 this.$message.warning("服务器异常");
//			 				this.$emit('close', { type: 'info', cancel: true });
//					 })
			},
			cancel() {
				this.$emit('close', { type: 'info', cancel: true })
			}
		}
	}
</script>

<style lang="less" scoped>
	.wrap {
		text-align: center;
	}
	.form {
		text-align: left;
	}
	 .input {
            width: 300px;
            display: inline-block;
        }

	.select-block {
		display: block;
	}

	.submit {
		width: 120px;
	}
</style>
